package ua.tach.shortl.logic;

import com.badlogic.gdx.math.Vector2;

public class RailPosition {
	public Rail base = Rail.NULL;
	public boolean dir; // position calculating from start(true) or from end(false)?
	public float pos;
	public Train train;
	public boolean atDepot;

	// Generated values for rendering
	public Vector2 renderCoord = new Vector2();
	public float rotate;

	public RailPosition () {
		pos = 0;
		train = null;
		dir = true;
		atDepot = false;
	}

	public RailPosition(RailPosition p) {
		pos = p.pos;
		dir = p.dir;
		base = p.base;
		train = p.train;
	}

	public boolean isCollision(RailPosition p) {
		if (p.renderCoord.dst2(renderCoord) < 0.03f) return true;
		return false;
	}
}
